<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
function conf(){
var x=confirm("Bạn có chắc chắn muốn xóa không?");
if(x==true)
return true;
else
return false;
}

</script>
</head>
<style type="text/css">
<!-- 
#th{

background:#FFCC99;
font-weight:bold;
}
#th:hover,#td:hover{
background:#CCFF99;
}

-->
</style>
<body>
<?php include("connect.php"); 
mysql_query("SET NAMES 'utf8' ",$link);
	$result = mysql_query("select * from submit",$link)or die("Loi chon database");	
	$row=mysql_num_rows($result);
?>
<form name="deleteall" method="post" action="proceed/p_deletepost.php">
<table width="1024" border="0" align="center" cellpadding="8" cellspacing="1">
  <tr id="th">
    <td colspan="2" align="center"><input type="checkbox" name="check" onclick="if(check.checked==true) checkall(); else uncheckall();"/>&nbsp; CheckAll</a></td>
    <td align="center">STT</td>
    <td align="center">Name</td>
    <td align="center">Email</td>
    <td align="center">Subject</td>
    <td align="center">Contents</td>
	<td align="center">Days post</td>
  </tr>
  <?php 
  $stt=0;
  while($rs=mysql_fetch_array($result))
  {
  $id=$rs['id'];
  $ten=$rs['ten'];
  $email=$rs['email'];
  $chude=$rs['chude'];
  $noidung=$rs['noidung'];
  $ngay=$rs['ngaypost'];
  if($stt%2 ==0)
  	echo "<tr id='td' bgcolor='#FFCCCC'>";
	else 
 echo " <tr id='td'>"; ?>
    <td width="24" align="center"><input type="checkbox" name="check[]" value="<?php echo $id; ?>" /></td>
    <td width="24" align="center"><a href="proceed/p_deletepost.php?id=<?php echo $id; ?>" title="Xóa" onclick="
	return conf();"><img src="include/image/b_drop.png" border="0" /></a></td>
    <td width="35" align="center"><?php echo $stt; ?></td>
    <td width="93"><?php echo $ten ;?></td>
    <td width="258"><?php echo $email ;?></td>
    <td width="67"><?php echo $chude ;?></td>
    <td width="66"><?php echo $noidung ;?></td>
	 <td width="66"><?php echo $ngay ;?></td>
  </tr>
  <?php  $stt = $stt +1;}?>
   <tr id="tf">
    <td colspan="2" align="center" bgcolor="#FFCCCC"><span id="result_box" lang="en" xml:lang="en"><input type="submit" name="deleteall" value="Delete" class="button"/></span></td>
    <td colspan="7" align="center" bgcolor="#FFCCCC"><span id="result_box" lang="en" xml:lang="en">Total items : <font color="#FF0000"><b><?php echo $row;?></b></font> </span></td>
  </tr>
</table>
</form>
</body>
</html>
